package com.huaxin.device.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huaxin.device.dto.ResponseResult;
import com.huaxin.device.dto.request.DeviceAlarmNotificationCreateReqDTO;
import com.huaxin.device.dto.request.DeviceAlarmNotificationPageListReqDTO;
import com.huaxin.device.dto.response.GetDeviceAlarmNotificationsByElectricianIdRespDTO;
import com.huaxin.device.models.DeviceAlarmNotification;
import com.huaxin.hxenum.enums.NotificationSendStatus;

import java.util.List;

public interface DeviceAlarmNotificationService extends IService<DeviceAlarmNotification> {

    /**
     * 创建设备报警通知
     */
    Boolean create(DeviceAlarmNotificationCreateReqDTO in);

    void create(List<DeviceAlarmNotificationCreateReqDTO> in);

    /**
     * 获取设备报警通知
     */
    DeviceAlarmNotification getByNotificationId(String id);

    /**
     * 分页查询设备报警通知
     */
    ResponseResult<IPage<DeviceAlarmNotification>> pageQuery(DeviceAlarmNotificationPageListReqDTO in);

    /**
     * 更新设备报警通知的发送状态
     */
    Boolean updateSendStatus(String id, NotificationSendStatus sendStatus);

    /**
     * 读取设备报警通知
     */
    ResponseResult<Boolean> read(String id);

    //根据电工id获取所关联的所有企业的设备预警通知
    ResponseResult<List<GetDeviceAlarmNotificationsByElectricianIdRespDTO>> getDeviceAlarmNotificationsByElectricianId(String electricianId);

    //根据企业id查询设备报警通知数量
    ResponseResult<Long> queryDeviceAlarmNotificationCountByOrgId(String orgId);
}